home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / NCSATelnetHack.txt < prev    next >
Text File  |  1996-01-30  |  4KB  |  85 lines

  1. Taken from Usenet, anonymous posting to alt.2600.moderated   31JAN96
  2.  
  3.  
  4. NCSA TELNET
  5. ~~~~ ~~~~~~
  6. 5) The NCSA Telnet application allows a user to use his or her Mac as a telnet
  7. client and wander around the Internet.  NCSA Telnet also handles incoming FTP
  8. requests.  While this FTP function is easily disabled, many users keep it on
  9. because they either use it regularly or don't even know it exists.
  10.  
  11. * Anyone with a valid username/password can log in to the Mac via FTP and then
  12. change to the "root" directory and perform the normal FTP functions.. both send
  13. and receive.  This means that *every* file on the Mac can be accessed from
  14. *anywhere* on the Internet.  It should be noted that NCSA Telnet does not log
  15. the "who & where" information, meaning there is no log of who used the machine,
  16. meaning there is no way for an intruder to be "caught."
  17.  
  18. * The file "ftppass" contains the list of users allowed to use FTP on that
  19. Macintosh.  If, by using one of the methods mentioned above, someone is able to
  20. access it, it is easily cracked as it has a rather pathetic encryption scheme:
  21. the data fork contains the user's name, a colon, and then an encrypted
  22. password.  The password is easily decrypted; unless it is the entire 10
  23. characters, the last few characters are in order.  That is, the next ASCII code
  24. is 1 + the previous, etc.  Observe this from my "ftppass" file:
  25.  
  26. sample:ucetcr&'()
  27.  
  28. The first part, "sample," is the user's name.  The colon is the basic UNIX-like
  29. delimiter, the rest is the password.  The "real" part of the password is the
  30. characters "ucetcr" ... the remaining "&'()" are just spaces... how do you
  31. tell?  It's in ASCII order.  Look up "&" on an ASCII chart and "'" will follow,
  32. then "(" then ")" .. you get the idea.
  33.  
  34. This password can be discovered by short program XORing the encrypted
  35. characters with a number between 0 and 255.  The program can either a) dump all
  36. XOR results or b) if the password is not the maximum length, the program can
  37. simply scan for a "space" [ASCII 032 decimal] in the password and print it.
  38. The following "cracking" program is written in BASIC [hey, does anyone use that
  39. any more?] and will allow you to decrypt the passwords.  If you can tell that
  40. the password has spaces at the end, you can go ahead and delete line 110.
  41. Otherwise, leave that line in and use your brain [remember your brain?] to
  42. determine if the encrypted goop is a "real" word or just goop.
  43.  
  44. 5 REM "ftppass" brute-force hacker
  45. 10 INPUT "Encrypted password:";I$
  46. 20 FOR X=1 TO 255
  47. 30 FOR Y=1 TO LEN(I$)
  48. 40 Y$=MID$(I$,Y,1)
  49. 50 YA=ASC(Y$)
  50. 60 N=X XOR YA
  51. 70 IF N=32 THEN F=1
  52. 80 N$=N$+CHR$(N)
  53. 90 NEXT Y
  54. 100 IF F THEN ?"Possible password:"N$
  55. 110 ?I$" 'encrypts' to "N$: REM U can delete this line if len<10
  56. 120 N$="":F=0
  57. 130 NEXT X
  58. 140 ?"Finished."
  59.  
  60. Sample run:  [with line 110 deleted]
  61.  
  62. Encrypted password:ucetcr&'()           [gotta type the whole thing]
  63. Possible password:secret !./            [boy, that was tough!]
  64. Possible password:rdbsdu! /.
  65. Possible password:}km|kz./ !            [etc.. just smack ^C at this point.]
  66.  
  67. So the password is "secret" [clever, no?]
  68.  
  69. It should be noted that this program is rather inelegant as I haven't really
  70. reversed the algorithm, just written a brute-force "hacker" for it.  This is
  71. due to laziness on my part.  If I really wanted to do this properly, I would
  72. FTP to the NCSA anonymous site and leech the 700k+ of source and "reverse" it
  73. thataway.  I don't feel like doing that.  I am lazy.  This program works just
  74. dandy for me... [I suspect the encryption program uses the users' name to
  75. encrypt it, but I don't care enough to find out.]
  76.  
  77. I should say that I don't wish to offend the makers of NCSA Telnet or call the
  78. application crap.  It is, indeed, an impressive piece of work; I simply feel
  79. that there are some aspects of it which could use improvement... if not in
  80. terms of security, then at least allowing the user to save selections to disk!
  81.  
  82. BTW- I know that NCSA Telnet is also available for the IBM.  I haven't tested
  83. these with an IBM, but if it's a "true" port, these flaws should exist under
  84. the IBM version as well.
  85.